<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>我的小可爱</title>
    <link type="text/css" rel="stylesheet" href="/css/love.css">
    <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>

    <script>
        $(document).ready(function () {

            $("#confirm").click(function () {
                $.ajax({
                    url: "/checkIsLove",
                    type: "post",
                    contentType: "application/json;charset=utf-8",
                    data: '{"answer":"' +  $("#answer").val()+ '"}',

                    success: function (data) {
                        if (data === "yes") {
                            window.location.href = "love_in";
                        }else{
                            alert("混蛋，快说你爱我")
                        }
                    },
                    error:function (data) {

                    }
                })

            })
        })
    </script>
</head>
<body>
        <div class="search-bar">
            <div class="search-bar-inner">
                <input type="tel" name="answer" id="answer" placeholder="你是我的小可爱吗？？？是的话快说你爱我" class="search">
                <input type="button" name="confirm" value="进入" id="confirm" class="btn">
            </div>
        </div>
</body>
</html>